<template>
  <div class="Child">
    <h3>我是Child组件(子)</h3>
    <Son />
  </div>
</template>

<script>
import { inject } from 'vue'
import Son from '../components/Son.vue'
export default {
  name: 'Child',
  components: {
    Son
  },
  setup() {
    let x = inject('car')
    console.log(x, '----Child---')
  }
}
</script>

<style>
.Child {
  background-color: gray;
  padding: 10px;
}
</style>
